﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BangleCMS.Model;
using BangleCMS.BLL;

public partial class newsdetail : WebPageBase
{
    #region
    private int _Id = 0;
    public int Id
    {
        get
        {
            return _Id;
        }
        set
        {
            _Id = value;
        }
    }

    private t_news _model;
    public t_news Model
    {
        get
        {
            return _model;
        }
        set
        {
            _model = value;
        }
    }

    private t_news _lastmodel;
    public t_news LastModel
    {
        get
        {
            return _lastmodel;
        }
        set
        {
            _lastmodel = value;
        }
    }

    private t_news _nextmodel;
    public t_news NextModel
    {
        get
        {
            return _nextmodel;
        }
        set
        {
            _nextmodel = value;
        }
    }
    #endregion

    #region 加载
    protected void Page_Load(object sender, EventArgs e)
    {
        Id = base.ParseQueryInt("id",0);
        getDate(Id);
    }
    #endregion

    #region 获得数据
    private void getDate(int id)
    {
        try
        {
            t_newsBLL bll = new t_newsBLL();
            Model = bll.GetModel(id);
            LastModel = bll.GetLastModel(id);
            NextModel = bll.GetNextModel(id);

            if (Model == null)
            {
                Model = new t_news();
            }
            else
            {
                Model.ReadCount++;
                bll.Update(Model);
            }
        }
        catch (Exception ex)
        {
        }
    }
    #endregion
}
